package blackhouse_server;

import java.sql.SQLException;
import java.util.List;

import blackhouse_dao.subjectadd_dao;
import blackhouse_entity.subject;

public class Subjectadd_server {
	subjectadd_dao subjectadd_dao=new subjectadd_dao();
	public boolean subjectadd_server(String subjectCode,String subjectName,String teacherName,int gradeId) throws SQLException
	{	
		String sql="INSERT INTO `t1831_project7`.`subject` ( `subjectCode`, `subjectName`, `teacherName`, `gradeId`) VALUES ('"+subjectCode+"', '"+subjectName+"', '"+teacherName+"', "+gradeId+")";
		if(subjectadd_dao.subjectadd_dao(sql)>0){
			return true;
		}else{
			return false;
		}
		
	}
}
